﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using PHMEE.DTOS.StatusMonitor;
using PHMEE.IServices.StatusMonitor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE.Controllers.StatusMonitor
{
    /// <summary>
    /// 设备状态监测🚢🌞🌛✨
    /// </summary>
    [Route("api/unitstatusmonitor")]
    public class UnitStatusMonitorController : PHMEEController
    {
        private readonly IUnitStatusMonitorAppService unitStatusMonitorAppService;

        public UnitStatusMonitorController(IUnitStatusMonitorAppService unitStatusMonitorAppService)
        {
            this.unitStatusMonitorAppService = unitStatusMonitorAppService;
        }


        /// <summary>
        /// 获取机组集合相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitStatusTabs")]
        public async Task<List<UnitStatusTabModel>> GetUnitStatusTabs(Guid VesselId)
        {
            return await unitStatusMonitorAppService.GetUnitStatusTabs(VesselId);
        }


        #region 主机机组


        /// <summary>
        /// 主机---获取参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainEngineMainParams")]
        public async Task<UnitMainModel> GetUnitMainEngineMainParams(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainEngineMainParams(VesselId, input);
        }

        /// <summary>
        /// 主机---获取气缸状态参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainEngineCylinderParams")]
        public async Task<List<UnitCylinderModel>> GetUnitMainEngineCylinderParams(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainEngineCylinderParams(VesselId, input);
        }

        /// <summary>
        /// 主机---获取主轴承温度参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainEngineMainBearTemps")]
        public async Task<List<UnitBearModel>> GetUnitMainEngineMainBearTemps(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainEngineMainBearTemps(VesselId, input);
        }


        /// <summary>
        /// 主机---获取增压器参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="OnVessel"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainEngineTurboChargerParams")]
        public async Task<List<UnitTurboChargerModel>> GetUnitMainEngineTurboChargerParams(Guid VesselId, bool OnVessel, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainEngineTurboChargerParams(VesselId, OnVessel, input);
        }


        /// <summary>
        /// 主机---获取测点相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainEnginePoints")]
        public async Task<List<UnitPointModel>> GetUnitMainEnginePoints(Guid VesselId, UnitPointInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainEnginePoints(VesselId, input);
        }


        #endregion


        #region 主发电机机组


        /// <summary>
        /// 主发电机柴油机---获取功率电流参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainGeneratorPowerCurrentParams")]
        public async Task<UnitPowerCurrentModel> GetUnitMainGeneratorPowerCurrentParams(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainGeneratorPowerCurrentParams(VesselId, input);
        }


        /// <summary>
        /// 主发电机柴油机---获取气缸状态参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainGeneratorDieselCylinderParams")]
        public async Task<List<UnitCylinderModel>> GetUnitMainGeneratorDieselCylinderParams(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainGeneratorDieselCylinderParams(VesselId, input);
        }

        /// <summary>
        /// 主发电机柴油机---获取图表状态参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainGeneratorDieselChartParams")]
        public async Task<UnitDieselChartModel> GetUnitMainGeneratorDieselChartParams(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainGeneratorDieselChartParams(VesselId, input);
        }

        /// <summary>
        /// 主发电机柴油机---获取主要参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainGeneratorDieselMainParams")]
        public async Task<UnitGeneratorDieselMainModel> GetUnitMainGeneratorDieselMainParams(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainGeneratorDieselMainParams(VesselId, input);
        }

        /// <summary>
        /// 主发电机柴油机---获取测点相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitMainGeneratorPoints")]
        public async Task<List<UnitPointModel>> GetUnitMainGeneratorPoints(Guid VesselId, UnitPointInput input)
        {
            return await unitStatusMonitorAppService.GetUnitMainGeneratorPoints(VesselId, input);
        }


        #endregion


        #region 压载泵机组



        /// <summary>
        /// 压载泵---获取功率电流参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitBallastPumpPowerCurrentParams")]
        public async Task<UnitPowerCurrentModel> GetUnitBallastPumpPowerCurrentParams(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitBallastPumpPowerCurrentParams(VesselId, input);
        }

        /// <summary>
        /// 压载泵---获取参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitBallastPumpMainParams")]
        public async Task<UnitBallastPumpMainModel> GetUnitBallastPumpMainParams(Guid VesselId, UnitBaseInput input)
        {
            return await unitStatusMonitorAppService.GetUnitBallastPumpMainParams(VesselId, input);
        }


        /// <summary>
        /// 压载泵---获取测点相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetUnitBallastPumpPoints")]
        public async Task<List<UnitPointModel>> GetUnitBallastPumpPoints(Guid VesselId, UnitPointInput input)
        {
            return await unitStatusMonitorAppService.GetUnitBallastPumpPoints(VesselId, input);
        }


        #endregion

    }
}
